#ifndef __DYNAMICARRAY_H_
#define __DYNAMICARRAY_H_

#include<stdbool.h>

#define ElementType void* //万能数组

struct DynamicArray; //结构体的前置声明
typedef struct DynamicArray DArray;


DArray *InitDArray(int capacity);
void InsertTail(DArray *array,ElementType element);
void PrintArray(DArray *array,void(*print)(ElementType));
ElementType* FindByElemrnt(DArray*array,ElementType element);
void RemoveByIndex(DArray *array,int index);
void RemoveByElement(DArray *array,ElementType element);
void FreeDArray(DArray *array,void(*Free)(ElementType));

// void Sort(DArray*a,bool(*Compare)(void*,void*));

#endif